package com.hzdp.dao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.hzdp.entity.Patient;

@Service
public class PatientDao extends BaseDao {

	public Patient find(int id) throws SQLException {
		return (Patient) queryObject("Patient.findById", id);
	}

	public List<Patient> findAll() throws SQLException {
		return queryList("Patient.findAll", null);
	}

	public void save(Patient entity) throws SQLException {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("po", entity);
		insert("Patient.insert", params);
	}
}